//router.js
var url = require('url');
var reqHandler = require("./reqHandler.js");
var reqHandle = new reqHandler();
var handle = {};
handle["/"] = reqHandle.start;
handle["/index"] = reqHandle.start;
handle["/show"] = reqHandle.show;
function route(req,res){
	var pathname = url.parse(req.url).pathname;
	if (typeof handle[pathname] == 'function'){
		return handle[pathname](res);
	}else{
		return reqHandle.notFound(res);
	}
}
exports.route = route;